package au.com.iglootech.silmbox_sm;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;

import au.com.iglootech.silmbox_sm.enities.User;
import au.com.iglootech.silmbox_sm.service.UserService;

import com.vaadin.Application;
import com.vaadin.ui.*;
@Configurable(preConstruction = true)
public class Silmbox_smApplication extends Application {
	@Autowired
	private UserService userService;
	
	@Override
	public void init() {
		Window mainWindow = new Window("Silmbox_sm Application");
		Label label = new Label("Hello Vaadin user");
		mainWindow.addComponent(label);
		setMainWindow(mainWindow);
        SpringContextHelper helper = new SpringContextHelper(this);
        UserService bean = (UserService) helper.getBean("userServiceImpl");
        
        bean.createUser(new User());
	}

}
